<template>
  <div class="header-input">
    <el-input
      v-model="input"
      placeholder="请输入内容"
      @change="changeInfo"
    ></el-input>
    <el-button type="primary" plain>查詢</el-button>
    <el-button type="primary" plain>添加</el-button>
  </div>
</template>

<script>
export default {
  name: "Search",
  data() {
    return {
      input: "",
    };
  },
  methods: {
    changeInfo(search) {
      // console.log(search);
      this.$api.search({ search }).then((res) => {
        // console.log(res);
        if (res.status == 200) {
          // console.log(res.result);
        } else {
          console.log("查無數據");
        }
      });
    },
  },
};
</script>

<style lang="less" scoped>
.header-input {
  display: flex;
  padding: 5px;
  input {
    margin: 0 5px;
  }
  button {
    margin: 0 5px;
  }
}
</style>